package com.entity;

import java.util.ArrayList;

/**
 * Created by wlc on 2018/9/12.
 */
public class UserFile {
    /**
     * 静态属性
     */
    private String id;
    private String userName;
    private String date;
    private String title;
    private String content;
    private String status;
    private String type;

    public UserFile(){
    }
    /**
     *数据成员设置和获取函数
     */
    public void setId(String id){
        this.id = id;
    }

    public String getId(){
        return id;
    }

    public void setUserId(String userId){
        this.userName = userId;
    }

    public String getUserId(){
        return userName;
    }

    public void setDate(String date){
        this.date = date;
    }

    public String getDate(){
        return date;
    }

    public void setTitle(String title){
        this.title = title;
    }

    public String getTitle(){
        return title;
    }

    public void setContent(String content){
        this.content = content;
    }

    public String getContent(){
        return content;
    }

    public void setStatus(String status){
        this.status = status;
    }

    public String getStatus(){
        return status;
    }

    public void setType(String type){
        this.type = type;
    }

    public String getType(){
        return type;
    }

    /**
     * 将用户文件转换为列表
     * @return ArrayList<String>
     */
    public ArrayList<String> userFileToList(){
        return new ArrayList<String>(){
            {
                add(id);
                add(userName);
                add(date);
                add(title);
                add(content);
                add(status);
                add(type);
            }
        };
    }

    /**
     * 将列表转换为用户文件
     * @param userFileList
     */
    public void listToUserFile(ArrayList<String> userFileList){
        this.id = userFileList.get(0);
        this.userName = userFileList.get(1);
        this.date = userFileList.get(2);
        this.title = userFileList.get(3);
        this.content = userFileList.get(4);
        this.status = userFileList.get(5);
        this.type = userFileList.get(6);
    }
}
